export type {Dispatch} from 'redux';
export type {Action} from 'reduxState/actions';
export type {LanType, LanSetting} from 'lang';
export type {ResponseType} from 'utils/request';
import {DataState} from 'reduxState/reducers/dataStateReducer';
import {SettingsState} from 'reduxState/reducers/settingsStateReducer';
import {UIState} from 'reduxState/reducers/uiStateReducer';
import {QueryState} from 'reduxState/reducers/queryStateReducer';
export type {UIState, DataState, SettingsState, QueryState};
import {MainStackParamList} from 'routers/MainStackNavigator';
// import { TabParamList } from 'routers/TabNavigator';
import {AuthStackParamList} from 'routers/AuthStackNavigator';

export type ScreensParamList = MainStackParamList & AuthStackParamList;
//   TabParamList &
//   AuthStackParamList;

interface WithTimeStamp {
  createdAt?: Date;
  updatedAt?: Date;
  deletedAt?: Date;
}

export interface ReduxState {
  uiState: UIState;
  dataState: DataState;
  settingsState: SettingsState;
  queryState: QueryState;
}

export interface User extends WithTimeStamp {
  id: number;
  avatar?: string;
  username: string;
  email: string;
}
export interface Auth {
  user: User;
  token: string;
}
export interface FeedLike extends WithTimeStamp {
  id: number;
  userId: number;
}

export interface Feed extends WithTimeStamp {
  id: string;
  images?: number[];
  desc?: string;
  feedLikes?: FeedLike[];
  user: User;
}

export interface Location {
  lat: number;
  lon: number;
}

export interface MapLocation extends Location {
  latDelta: number;
  lonDelta: number;
}

export interface Channel extends WithTimeStamp {
  id: number | string;
  name: string;
}

export interface EventType extends WithTimeStamp {
  id: number;
  name: string;
  location: string;
  location_detail: string;
  me_going: boolean;
  me_likes: boolean;
  goings_count: number;
  likes_count: number;
  images?: string[];
  description: string;
  channel?: Channel;
  creator: User;
  begin_time: string;
  end_time: string;
}

export interface TimeMeta extends WithTimeStamp {
  name?: string;
  after: number | string;
  before: number | string;
}

export interface CommentType extends WithTimeStamp {
  id: number;
  comment: string;
  eventId: number;
  user: User;
  userId: number;
}
